package com.hangzhou.welbeing.welbeinginstrument.fragement;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.adapter.PayAttentionToAdapter;
import com.hangzhou.welbeing.welbeinginstrument.base.MyApplication;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;

import butterknife.Bind;
import butterknife.ButterKnife;


/**
 * 时间 2017 年 08 月 28.
 * 作者 Administrator  刘传华
 * 公司 杭州惟君医疗科技有限公司
 * 包名 com.hangzhou.welbeing.pregnant.welbeing_pregnant.fragement
 * 工程名 welbeing_pregnant
 *
 * @desc 最热Fragment
 */
public class HottestFragment extends Fragment {
    @Bind(R.id.fragment_hottest_XRecyclerView)
    XRecyclerView fragmentHottestXRecyclerView;
    private Context mcontext = MyApplication.getMcontext();

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = View.inflate(mcontext, R.layout.fragment_hottest, null);
        ButterKnife.bind(this, view);
        LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        fragmentHottestXRecyclerView.setLayoutManager(layoutManager);
        fragmentHottestXRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
        fragmentHottestXRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);

        fragmentHottestXRecyclerView.setPullRefreshEnabled(false);
        PayAttentionToAdapter payAttentionToAdapter =   new PayAttentionToAdapter();
        fragmentHottestXRecyclerView.setAdapter(payAttentionToAdapter);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
